angular.module("driver").controller("ListCtrl", ['$scope', '$state', '$meteor', '$ionicPopover',
	function($scope, $state, $meteor, $ionicPopover) {

		$meteor.subscribe('users', Session.get('location')).then(function(subscriptionHandle) {
			$scope.users = $meteor.collection(Meteor.users);
		});

		$meteor.subscribe('userrequests').then(function(subscriptionHandle) {
			$scope.userrequests = $meteor.collection(UserRequests);
		});
		$ionicPopover.fromTemplateUrl('client/driver/views/popover.html', {
			scope: $scope,
		}).then(function(popover) {
			$scope.popover = popover;
		});

		$scope.demo = 'ios';
		$scope.setPlatform = function(p) {
			document.body.classList.remove('platform-ios');
			document.body.classList.remove('platform-android');
			document.body.classList.add('platform-' + p);
			$scope.demo = p;
		}

	}
]);